﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DevTools.ClassStuffGenerator.Components
{
    public static class Extensions
    {
        public static string[] ToArray(this string text)
        {
            var array = text.Split(new[] {" ", Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries);
            return Array.ConvertAll(array, x => x.Trim());
        }

        public static bool BelongsTo(this string value, string[] array)
        {
            return array.Any(value.Contains);
        }
    }
}
